/**
 *  Java Api For Ecco Generated Applications 
 *  
 *  Copyright (C) 2000  by PDTec GmbH 
 *
 * @author  Michael Weirich
 */
package pdtec.ecco.inst;

import pdtec.ecco.meta.EccoException;
import pdtec.ecco.meta.Type;

/** Objects of this class represent equivalent  EXPRESS types SET,BAG,LIST and AGGREGATE
 * @see pdtec.ecco.inst.Instance
 * @see pdtec.ecco.inst.Value
 */
public class AggregateValue extends Value {

    /** Constructor enables instance creation by type. */
    public AggregateValue(Type type) {
	super(type);
    } // constructor 
    
    /** This constructor is protected since instance creation is delegated to the static
     * {@link pdtec.ecco.inst.Value#get(int,long) get(..) } method.
     */
    protected AggregateValue(int appId, long id) {
	super(appId,id);
    } // AggregateValue 

    /** Returns size of aggregate.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized long sizeOf() throws EccoException;
    
    /** Assignment for one-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void assignAt(Value obj, long index) throws EccoException;
    
    /** Assignment for multi-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void assignAt(Value obj, long[] index) throws EccoException;
    
    /** Index operator for one-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized Value index(long index) throws EccoException;

    /** Index operator for multi-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized Value index(long[] index) throws EccoException;
    
    /** Insertion for one-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void insert(Value obj, long index) throws EccoException;

    /** Insertion for multi-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void insert(Value obj, long[] index) throws EccoException;

    /** Removal by indexing for one-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void remove(long index) throws EccoException;

    /** Removal by indexing for multi-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void remove(long[] index) throws EccoException;

    /** Removal by element comparison for one-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void removeElement(Value obj) throws EccoException;

    /** Removal by element comparison for multi-dimensional aggregates.
     * @exception pdtec.ecco.meta.EccoException in case an error occurs
     */
    public native synchronized void removeElement(Value obj, long[] index) throws EccoException;
    
    /** Finalizes objects of class AggregateValue. */
    protected void finalize() {
	  super.finalize();
	  } // finalize

} // class AggregateValue



